package com.dd.cloud.user.controller;

import com.dd.cloud.user.service.supervision.ISupervisionDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;


/**
 * 医疗监管数据
 * @author xt
 */
@Validated
@RestController
@RequestMapping("/supervision")
public class SupervisionController {

    @Autowired
    private ISupervisionDataService supervisionDataService;


    /**
     * 导入监管平台数据
     */
    @PostMapping("/import/data")
    public ResponseEntity<Void> importData(@NotNull(message = "文件不能为空") MultipartFile file){
        supervisionDataService.importData(file);
        return ResponseEntity.ok().build();
    }

}
